<?php

class Pc {
	public $id;

	function __construct($id) {
		$this->id = $id;
	}

	function get($list, $data) {
		$query = "SELECT id FROM n_wb_pc_". $this->id ." WHERE record=\"$list\"";
		$result = mysql_query($query);
		if($next = mysql_fetch_assoc($result)) {
			$table_id = $next["id"];

			$query = "SELECT value FROM n_wb_pc_". $this->id ."_$table_id"
				. " WHERE data=\"$data\"";
			$result = mysql_query($query);
			if($next = mysql_fetch_assoc($result)) {
				return $next["value"];
			}
		}

		// failed to locate data
		return "";
	}
}

?>
